home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / Src / MTAconsole / ops.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-18  |  17.1 KB  |  767 lines

  1. /* ops.c: encoding and decoding routines for qmgr interaction */
  2.  
  3. # ifndef lint
  4. static char Rcsid[] = "@(#)$Header: /xtel/pp/pp-beta/Src/MTAconsole/RCS/ops.c,v 6.0 1991/12/18 20:26:48 jpo Rel $";
  5. # endif
  6.  
  7. /*
  8.  * $Header: /xtel/pp/pp-beta/Src/MTAconsole/RCS/ops.c,v 6.0 1991/12/18 20:26:48 jpo Rel $
  9.  *
  10.  * $Log: ops.c,v $
  11.  * Revision 6.0  1991/12/18  20:26:48  jpo
  12.  * Release 6.0
  13.  *
  14.  */
  15.  
  16.  
  17.  
  18. #include    "console.h"
  19. #include    "Qmgr-types.h"
  20. #include    <isode/rosy.h>
  21.  
  22. extern Widget            channel_label,
  23.                 mta_label,
  24.                 msg_label;
  25. extern struct chan_struct    **globallist,
  26.                 *currentchan,
  27.                 *find_channel();
  28. extern char            *mystrtotime();
  29. extern int            forceDown;
  30.  
  31. time_t    boottime = 0;
  32. int    messagesIn = 0, messagesOut = 0, addrIn = 0, addrOut = 0, 
  33.     maxChans = 0, currChans = 0;
  34. double  opsPerSec = 0.0, runnableChans = 0.0, 
  35.     msgsInPerSec = 0.0, msgsOutPerSec = 0.0;
  36.  
  37. /*   */
  38. /* channel operations */
  39.  
  40. #define     CHAN_READ_INTERVAL    60    /* in secs */
  41.  
  42. CMD_TABLE    chantbl_commands [] = {
  43.     "start",    (int) chanstart,
  44.     "stop",        (int) chanstop,
  45.     "clear",    (int) chanclear,
  46.     "info",        (int) chaninfo,
  47.     "cache add",    (int) chancacheadd,
  48.     0,        0
  49.     };
  50.  
  51. /* ARGSUSED */
  52. int do_channelread (ad, ds, args, arg)
  53. int                ad;
  54. struct client_dispatch        *ds;
  55. char                **args;
  56. struct type_UNIV_UTCTime    **arg;
  57. {
  58.     char    *str;
  59.     UTC    utc;
  60.           
  61.     utc = (UTC) malloc (sizeof(struct UTCtime));
  62.     utc->ut_flags = UT_SEC;
  63.  
  64.     utc->ut_sec = CHAN_READ_INTERVAL;
  65.  
  66.     str = utct2str(utc);
  67.     *arg = str2qb (str, strlen(str), 1);
  68.     return OK;
  69. }
  70.  
  71. /* ARGSUSED */
  72. int do_channelcontrol (ad, ds, args, arg)
  73. int                ad;
  74. struct client_dispatch        *ds;
  75. char                **args;
  76. struct type_Qmgr_ChannelControl    **arg;
  77. /* args[0] = channel */
  78. /* args[1] = stop,start,clear,cacheadd */
  79. /* args[2] = time */
  80. {
  81.     char    *timestr;
  82.     *arg = (struct type_Qmgr_ChannelControl *) malloc(sizeof(**arg));
  83.     (*arg)->control = (struct type_Qmgr_Control *)
  84.         malloc(sizeof(struct type_Qmgr_Control));
  85.  
  86.     (*arg)->channel = str2qb(args[0],
  87.                  strlen(args[0]),
  88.                  1);
  89.     switch (cmd_srch(args[1], chantbl_commands)) {
  90.         case chanstart:
  91.         (*arg)->control->offset = type_Qmgr_Control_start;
  92.         break;
  93.         case chanstop:
  94.         (*arg)->control->offset = type_Qmgr_Control_stop;
  95.         break;
  96.         case chanclear:
  97.         (*arg)->control->offset = type_Qmgr_Control_cacheClear;
  98.         break;
  99.         case chancacheadd:
  100.         (*arg)->control->offset = type_Qmgr_Control_cacheAdd;
  101.         timestr = mystrtotime(args[2]);
  102.         (*arg)->control->un.cacheAdd = str2qb(timestr,strlen(timestr),1);
  103.         free(timestr);
  104.         break;
  105.         default:
  106.         PP_LOG(LLOG_EXCEPTIONS,
  107.                ("console : '%s' unknown control param for channels",
  108.             args[1]));
  109.         return NOTOK;
  110.     }
  111.     return OK;
  112. }
  113.  
  114. extern time_t    time();
  115.  
  116. extern int        firstChanRead;
  117. extern Widget        top, channel_viewport;
  118.  
  119. /* ARGSUSED */
  120. int channelcontrol_result (ad, id, dummy, result, roi)
  121. int                            ad,
  122.                             id,
  123.                             dummy;
  124. register struct type_Qmgr_PrioritisedChannelList    *result;
  125. struct RoSAPindication                    *roi;
  126. {
  127.     Dimension    width,
  128.             height;
  129.     extern time_t    currentTime;
  130.     time(¤tTime);
  131.     channel_list(result);
  132.  
  133.     if (globallist != NULL) {
  134.         display_channels();
  135.         if (firstChanRead == TRUE) {
  136.             XtVaGetValues(channel_viewport,
  137.                   XtNwidth,    &width,
  138.                   XtNheight,     &height,
  139.                   NULL);
  140.             XtVaSetValues(channel_viewport,
  141.                   XtNheight,    height-1,
  142.                   XtNwidth,    width-1,
  143.                   NULL);
  144.         }
  145.         reset_label(channel_label);
  146.         return OK;
  147.     } else {
  148.         currentchan = NULL;
  149.     }
  150.     reset_label(channel_label);
  151.     return NOTOK;
  152. }
  153.  
  154. extern int compat;
  155.  
  156. /* ARGSUSED */
  157. int channelread_result (ad, id, dummy, result, roi)
  158. int                            ad,
  159.                             id,
  160.                             dummy;
  161. register struct type_Qmgr_ChannelReadResult        *result;
  162. struct RoSAPindication                    *roi;
  163. {
  164.     Dimension    width,
  165.             height;
  166.     extern time_t    currentTime;
  167.     time(¤tTime);
  168.  
  169.     if (compat) {
  170.         runnableChans = (double) result->load1;
  171.         opsPerSec = (double) result->load2;
  172.         currChans = (int) result->currchans;
  173.         maxChans = (int) result->maxchans;
  174.     }
  175.     channel_list(result->channels);
  176.  
  177.     if (globallist != NULL) {
  178.         display_channels();
  179.         if (firstChanRead == TRUE) {
  180.             XtVaGetValues(channel_viewport,
  181.                   XtNwidth,    &width,
  182.                   XtNheight,     &height,
  183.                   NULL);
  184.             XtVaSetValues(channel_viewport,
  185.                   XtNheight,    height-1,
  186.                   XtNwidth,    width-1,
  187.                   NULL);
  188.         }
  189.         reset_label(channel_label);
  190.         return OK;
  191.     } else {
  192.         currentchan = NULL;
  193.     }
  194.     reset_label(channel_label);
  195.     return NOTOK;
  196. }
  197.  
  198. /* ARGSUSED */
  199. int op_channelread (ad, ryo, rox, in, roi)
  200. int            ad;
  201. struct RyOperation    *ryo;
  202. struct RoSAPinvoke    *rox;
  203. caddr_t            in;
  204. struct RoSAPindication    *roi;
  205. {
  206.     register struct type_Qmgr_ChannelReadResult    *arg;
  207.  
  208.     arg = (struct type_Qmgr_ChannelReadResult *) in;
  209.  
  210.     channel_list(arg->channels);
  211.  
  212.     if (compat) {
  213.         runnableChans = (double) arg->load1;
  214.         opsPerSec = (double) arg -> load2;
  215.         currChans = arg->currchans;
  216.         maxChans = arg->maxchans;
  217.     }
  218.     if (globallist != NULL) {
  219.         display_channels();
  220.         return OK;
  221.     } else {
  222.         currentchan = NULL;
  223.     }
  224.     reset_label(channel_label);
  225.     return NOTOK;
  226. }
  227.  
  228. /*   */
  229. /* mtas */
  230. extern struct mta_struct    *find_mta(),
  231.                 *currentmta;
  232. extern struct chan_struct    *mta_list();
  233. extern Mode            mode;
  234.  
  235. #define     MTA_READ_INTERVAL    60    /* in secs */
  236.  
  237. CMD_TABLE    mtatbl_commands [] = {
  238.     "start",    (int) mtastart,
  239.     "stop",        (int) mtastop,
  240.     "clear",    (int) mtaclear,
  241.     "info",        (int) mtainfo,
  242.     "cache add",    (int) mtacacheadd,
  243.     0,        0
  244.     };
  245.  
  246. /* ARGSUSED */
  247. int do_mtaread (ad, ds, args, arg)
  248. int                ad;
  249. struct client_dispatch        *ds;
  250. char                **args; /* args[0] is channel name */
  251. struct type_Qmgr_MtaRead    **arg;
  252. {
  253.     char    *str;
  254.     UTC    utc;
  255.  
  256.     *arg = (struct type_Qmgr_MtaRead *) malloc(sizeof(**arg));
  257.     utc = (UTC) malloc (sizeof(struct UTCtime));
  258.  
  259.     utc->ut_flags = UT_SEC;
  260.     utc->ut_sec = MTA_READ_INTERVAL;
  261.     str = utct2str(utc);
  262.     (*arg)->time = str2qb(str, strlen(str), 1);
  263.  
  264.     (*arg)->channel = str2qb(args[0],
  265.                  strlen(args[0]),
  266.                  1);
  267.     return OK;
  268. }
  269.  
  270. /* ARGSUSED */
  271. int do_mtacontrol (ad, ds, args, arg)
  272. int                ad;
  273. struct client_dispatch        *ds;
  274. char                **args;
  275. struct type_Qmgr_MtaControl    **arg;
  276. /* args[0] = channel */
  277. /* args[1] = mta */
  278. /* args[2] = stop,start,clear,cacheadd */
  279. /* args[3] = time */
  280. {
  281.     char    *timestr;
  282.     *arg = (struct type_Qmgr_MtaControl *) malloc(sizeof(**arg));
  283.     (*arg)->control = (struct type_Qmgr_Control *)
  284.         malloc(sizeof(struct type_Qmgr_Control));
  285.  
  286.     (*arg)->channel = str2qb(args[0],
  287.                  strlen(args[0]),
  288.                  1);
  289.     (*arg)->mta = str2qb(args[1],
  290.                  strlen(args[1]),
  291.                  1);
  292.  
  293.     switch (cmd_srch(args[2], mtatbl_commands)) {
  294.         case mtastart:
  295.         (*arg)->control->offset = type_Qmgr_Control_start;
  296.         break;
  297.         case mtastop:
  298.         (*arg)->control->offset = type_Qmgr_Control_stop;
  299.         break;
  300.         case mtaclear:
  301.         (*arg)->control->offset = type_Qmgr_Control_cacheClear;
  302.         break;
  303.         case mtacacheadd:
  304.         (*arg)->control->offset = type_Qmgr_Control_cacheAdd;
  305.         timestr = mystrtotime(args[3]);
  306.         (*arg)->control->un.cacheAdd = str2qb(timestr,strlen(timestr),1);
  307.         free(timestr);
  308.         break;
  309.         default:
  310.         PP_LOG(LLOG_EXCEPTIONS,
  311.                ("console : '%s' unknown control param for mtas",
  312.             args[2]));
  313.         return NOTOK;
  314.     }
  315.     return OK;
  316. }
  317.  
  318. /* ARGSUSED */
  319. int mtacontrol_result (ad, id, dummy, result, roi)
  320. int                        ad,
  321.                         id,
  322.                         dummy;
  323. register struct type_Qmgr_MtaInfo        *result;
  324. struct RoSAPindication                *roi;
  325. {
  326.     char            *chan_name,
  327.                 *name;
  328.     struct chan_struct    *chan;
  329.     struct mta_struct    *mta;
  330.  
  331.     chan_name = qb2str(result->channel);
  332.     chan = find_channel(chan_name);
  333.  
  334.     if (chan == NULL) {
  335.         PP_LOG(LLOG_EXCEPTIONS,
  336.                ("console: mtacontrol_result can't find channel %s",chan_name));
  337.         return NOTOK;
  338.     }
  339.  
  340.     name = qb2str(result->mta);
  341.     mta = find_mta(chan, name);
  342.  
  343.     if (mta == NULL) {
  344.         if (forceDown != TRUE) 
  345.             PP_NOTICE(("can not find mta %s on channel %s",
  346.                    name, chan_name));
  347.         free(chan_name);
  348.         free(name);
  349.         return OK;
  350.     } else {
  351.         update_mta(mta,result);
  352.     }
  353.                
  354.     currentchan = chan;
  355.  
  356.     order_mtas(&(chan->mtalist),chan->num_mtas);
  357.     display_mtas(chan);
  358.     reset_label(mta_label);
  359.     free(chan_name);
  360.     free(name);
  361.     return OK;
  362. }
  363.  
  364. extern char    *pop_from_mta_refresh_list();
  365.  
  366. /* ARGSUSED */
  367. int mtaread_result (ad, id, dummy, result, roi)
  368. int                        ad,
  369.                         id,
  370.                         dummy;
  371. register struct type_Qmgr_PrioritisedMtaList    *result;
  372. struct RoSAPindication                *roi;
  373. {
  374.     struct chan_struct    *chan;
  375.     char    *mtaname = NULL;
  376.     char    *channame;
  377.  
  378.     channame  = pop_from_mta_refresh_list();
  379.  
  380.     if (currentmta != NULL)
  381.         mtaname = strdup(currentmta->mta);
  382.     chan = mta_list(result, channame);
  383.     free(channame);
  384.  
  385.     if (forceDown == TRUE
  386.         && chan != currentchan) {
  387.         if (chan != NULL) {
  388.             free_mta_list(&(chan->mtalist), &(chan->num_mtas));
  389.             chan->mtalist = NULL;
  390.             chan->num_mtas = 0;
  391.         }
  392.         return OK;
  393.     }
  394.     if ((mode == monitor && chan != NULL)
  395.         || (mode == control && chan != NULL && chan == currentchan)) {
  396.         order_mtas(&(chan->mtalist),chan->num_mtas);
  397.         if (mtaname != NULL) {
  398.             /* reset currentmta */
  399.             currentmta = find_mta(chan, mtaname);
  400.             free(mtaname);
  401.         }
  402.         reset_label(mta_label);
  403.         display_mtas(chan);
  404.         return OK;
  405.     } else if (mode == control) {
  406.         display_empty_mta_list(currentchan);
  407.         currentmta = NULL;
  408.         display_empty_msg_list();
  409.         reset_label(mta_label);
  410.         return OK;
  411.     } else {
  412.         /* fill in here */
  413.         PP_LOG(LLOG_EXCEPTIONS,
  414.                ("MTAconsole in confused state"));
  415.     }
  416.     return NOTOK;
  417. }
  418.  
  419. /* ARGSUSED */
  420. int op_mtaread (ad, ryo, rox, in, roi)
  421. int            ad;
  422. struct RyOperation    *ryo;
  423. struct RoSAPinvoke    *rox;
  424. caddr_t            in;
  425. struct RoSAPindication    *roi;
  426. {
  427.     register struct type_Qmgr_PrioritisedMtaList    *arg;
  428.     struct chan_struct                *chan;
  429.     char                        *mtaname=NULL, 
  430.                             *channame;
  431.     arg = (struct type_Qmgr_PrioritisedMtaList *) in;
  432.     channame = pop_from_mta_refresh_list();
  433.     if (currentmta != NULL)
  434.         mtaname = strdup(currentmta->mta);
  435.     currentmta = NULL;
  436.     chan = mta_list(arg, channame);
  437.     free(channame);
  438.     if (chan != NULL) {
  439.         order_mtas(&(chan->mtalist),chan->num_mtas);
  440.         if (mtaname != NULL) {
  441.             /* reset currentmta */
  442.             currentmta = find_mta(chan, mtaname);
  443.             free(mtaname);
  444.         }
  445.         reset_label(mta_label);
  446.         display_mtas(chan);
  447.         return OK;
  448.     }
  449.     reset_label(mta_label);
  450.     return NOTOK;
  451. }
  452.  
  453. /*   */
  454. /* msgs */
  455. struct msg_struct        *currentmsg,
  456.                 **global_msg_list,
  457.                 *find_msg();
  458. struct type_Qmgr_UserList    *create_userlist();
  459. struct type_Qmgr_FilterList    *fillinfilters();
  460. #define     MSG_READ_INTERVAL    60    /* in secs */
  461.  
  462. CMD_TABLE    msgtbl_commands [] = {
  463.     "start",    (int) msgstart,
  464.     "stop",        (int) msgstop,
  465.     "clear",    (int) msgclear,
  466.     "info",        (int) msginfo,
  467.     "cache add",    (int) msgcacheadd,
  468.     0,        0
  469.     };
  470.  
  471. /* ARGSUSED */
  472. int do_msgcontrol (ad, ds, args, arg)
  473. int                ad;
  474. struct client_dispatch        *ds;
  475. char                **args;
  476. struct type_Qmgr_MsgControl    **arg;
  477. /* args[0] = qid */
  478. /* args[1] = time */
  479. /* args[2] = stop, start, clear cacheadd*/
  480. /* args[3..] = NULL terminated list of users */
  481. {
  482.     char    *timestr;
  483.     *arg = (struct type_Qmgr_MsgControl *) malloc(sizeof(**arg));
  484.     
  485.     (*arg)->qid = str2qb(args[0],
  486.                  strlen(args[0]),
  487.                  1);
  488.  
  489.     (*arg)->users = create_userlist(args[0], &(args[3]));
  490.  
  491.     (*arg)->control = (struct type_Qmgr_Control *)
  492.         malloc(sizeof(struct type_Qmgr_Control));
  493.  
  494.     switch (cmd_srch(args[2], msgtbl_commands)) {
  495.         case msgstart:
  496.         (*arg)->control->offset = type_Qmgr_Control_start;
  497.         break;
  498.         case msgstop:
  499.         (*arg)->control->offset = type_Qmgr_Control_stop;
  500.         break;
  501.         case msgclear:
  502.         (*arg)->control->offset = type_Qmgr_Control_cacheClear;
  503.         break;
  504.         case msgcacheadd:
  505.         (*arg)->control->offset = type_Qmgr_Control_cacheAdd;
  506.         timestr = mystrtotime(args[1]);
  507.         (*arg)->control->un.cacheAdd = str2qb(timestr,strlen(timestr),1);
  508.         free(timestr);
  509.         break;
  510.         default:
  511.         PP_LOG(LLOG_EXCEPTIONS,
  512.                ("console : '%s' unknown control param for msgs",
  513.             args[1]));
  514.         return NOTOK;
  515.     }
  516.     return OK;
  517. }
  518.  
  519. extern char    *msginfo_args[3];
  520.  
  521. /* ARGSUSED */
  522. msgcontrol_result (sd, id, dummy, result, roi)
  523. int                    sd,
  524.                                     id,
  525.                                     dummy;
  526. struct type_Qmgr_Pseudo__newmessage     *result;
  527. struct RoSAPindication            *roi;
  528. {
  529.     if (currentchan != NULL
  530.         && currentmta != NULL) {
  531.         msginfo_args[0] = currentchan->channelname;
  532.         msginfo_args[1] = currentmta->mta;
  533.         if (is_loc_chan(currentchan) == TRUE)
  534.             /* local */
  535.             msginfo_args[2] = (char *) 1;
  536.         else
  537.             msginfo_args[2] = (char *) 0;
  538.         construct_event(readchannelmtamessage);
  539.     }
  540.     return OK;
  541. }
  542.  
  543. /* ARGSUSED */
  544. int do_readchannelmtamessage (ad, ds, args, arg)
  545. int                ad;
  546. struct client_dispatch        *ds;
  547. char                **args; 
  548. /* args[0] = chan args[1] = mta or name in case of local chan */
  549. struct type_Qmgr_MsgRead    **arg;
  550. {
  551.     char    *str;
  552.     UTC    utc;
  553.  
  554.     *arg = (struct type_Qmgr_MsgRead *) malloc(sizeof(**arg));
  555.     bzero ((char *) *arg, sizeof(**arg));
  556.     /* fillin time */
  557.     utc = (UTC) malloc (sizeof(struct UTCtime));
  558.  
  559.     utc->ut_flags = UT_SEC;
  560.     utc->ut_sec = MSG_READ_INTERVAL;
  561.     str = utct2str(utc);
  562.     (*arg)->time = str2qb(str, strlen(str), 1);
  563.     if (args[0] != NULLCP)
  564.         (*arg)->channel = str2qb(args[0], strlen(args[0]), 1);
  565.     if (args[1] != NULLCP)
  566.         (*arg)->mta = str2qb(args[1], strlen(args[1]), 1);
  567.     return OK;
  568. }
  569.  
  570. /* ARGSUSED */
  571. int readchannelmtamessage_result (ad, id, dummy, result, roi)
  572. int                        ad,
  573.                         id,
  574.                         dummy;
  575. register struct type_Qmgr_MsgList        *result;
  576. struct RoSAPindication                *roi;
  577. {
  578.     char    *msgname = NULL;
  579.     if (currentmsg != NULL)
  580.         msgname = strdup(currentmsg->msginfo->queueid);
  581.     msg_list(result);
  582.  
  583.     if (forceDown == TRUE) {
  584.         free_msg_list();
  585.         global_msg_list = NULL;
  586.     }
  587.         
  588.     if (global_msg_list != NULL){
  589.         order_msgs();
  590.         if (msgname != NULL) {
  591.             /* reset currentmsg */
  592.             currentmsg = find_msg(msgname);
  593.             free(msgname);
  594.         }
  595.         reset_label(msg_label);
  596.         display_msgs();
  597.         return OK;
  598.     } else {
  599.         display_empty_msg_list();
  600.     }
  601.     reset_label(msg_label);
  602.     return NOTOK;
  603. }
  604.  
  605. /* ARGSUSED */
  606. int op_readchannelmtamessage (ad, ryo, rox, in, roi)
  607. int            ad;
  608. struct RyOperation    *ryo;
  609. struct RoSAPinvoke    *rox;
  610. caddr_t            in;
  611. struct RoSAPindication    *roi;
  612. {
  613.     register struct type_Qmgr_MsgList    *arg;
  614.     char    *msgname = NULL;
  615.     arg = (struct type_Qmgr_MsgList *) in;
  616.     if (currentmsg != NULL)
  617.         msgname = strdup(currentmsg->msginfo->queueid);
  618.     currentmsg = NULL;
  619.     msg_list(arg);
  620.  
  621.     if (global_msg_list != NULL){
  622.         order_msgs();
  623.         if (msgname != NULL) {
  624.             /* reset currentmsg */
  625.             currentmsg = find_msg(msgname);
  626.             free(msgname);
  627.         }
  628.         reset_label(msg_label);
  629.         display_msgs();
  630.         return OK;
  631.     }
  632.     reset_label(msg_label);
  633.     return NOTOK;
  634.     
  635. }
  636.  
  637.  
  638. struct type_Qmgr_FilterList    *fillinfilters(args)
  639. char    **args;
  640. /* args[0] = chan args[1] = mta or name in case of local chan */
  641. {
  642.     struct type_Qmgr_FilterList    *retval = 
  643.         (struct type_Qmgr_FilterList *) calloc(1, sizeof(*retval));
  644.     
  645.     retval->Filter = 
  646.         (struct type_Qmgr_Filter *) calloc(1, sizeof(*retval->Filter));
  647.     
  648.     retval->Filter->channel = str2qb(args[0], strlen(args[0]), 1);
  649.     if (args[1] != NULLCP) {
  650.         if (args[2] == (char *) 1)
  651.             retval->Filter->recipient = str2qb(args[1], strlen(args[1]), 1);
  652.         else
  653.             retval->Filter->mta = str2qb(args[1], strlen(args[1]), 1);
  654.     }
  655.     return retval;
  656. }
  657.  
  658.  
  659. struct type_Qmgr_UserList    *create_userlist(qid, argv)
  660. char    *qid,
  661.     **argv;
  662. {
  663.     struct type_Qmgr_UserList    *temp,
  664.                     *head = NULL,
  665.                     *tail = NULL;
  666.     int                i = 0;
  667.     struct msg_struct        *msg;
  668.     struct recip            *ix;
  669.  
  670.     if (strcmp(argv[i], "*") == 0) {
  671.         if ((msg = find_msg(qid)) == NULL)
  672.             return NULL;
  673.         ix = msg -> reciplist;
  674.         while (ix != NULL) {
  675.             temp = (struct type_Qmgr_UserList *) 
  676.                 calloc (1, sizeof(*temp));
  677.             temp->RecipientId = (struct type_Qmgr_RecipientId *) 
  678.                 malloc(sizeof(struct type_Qmgr_RecipientId));
  679.             temp->RecipientId->parm = ix -> id;
  680.             ix = ix -> next;
  681.             if (head == NULL)
  682.                 head = tail = temp;
  683.             else {
  684.                 tail->next = temp;
  685.                 tail = tail->next;
  686.             }
  687.         }
  688.     } else {
  689.         while (argv[i] != NULL) {
  690.             temp = (struct type_Qmgr_UserList *) 
  691.                 calloc (1, sizeof(*temp));
  692.             temp->RecipientId = (struct type_Qmgr_RecipientId *) 
  693.                 malloc(sizeof(struct type_Qmgr_RecipientId));
  694.             temp->RecipientId->parm = atoi(argv[i++]);
  695.         
  696.             if (head == NULL)
  697.                 head = tail = temp;
  698.             else {
  699.                 tail->next = temp;
  700.                 tail = tail->next;
  701.             }
  702.         }
  703.     }
  704.     return head;
  705. }
  706.  
  707. /* ARGSUSED */
  708. int do_quecontrol (ad, ds, args, arg)
  709. int            ad;
  710. struct client_dispatch    *ds;
  711. int            args;
  712. struct type_Qmgr_QMGROp **arg;
  713. {
  714.     *arg = (struct type_Qmgr_QMGROp *) malloc(sizeof(**arg));
  715.     (*arg)->parm = args;
  716.     return OK;
  717. }
  718.  
  719. /* ARGSUSED */
  720. int quecontrol_result (ad, id, dummy, result, roi)
  721. int    ad,
  722.     id,
  723.     dummy;
  724. struct type_Qmgr_Pseudo__qmgrControl    *result;
  725. struct RoSAPindication            *roi;
  726. {
  727.     return OK;
  728. }
  729.  
  730. extern int total_volume, total_number_messages, total_number_reports;
  731. extern int delta_volume, delta_messages, delta_reports;
  732.  
  733. /* ARGSUSED */
  734. int qmgrStatus_result (ad, id, dummy, result, roi)
  735. int    ad,
  736.     id,
  737.     dummy;
  738. struct type_Qmgr_QmgrStatus    *result;
  739. struct RoSAPindication    *roi;
  740. {
  741.     if (result) {
  742.         if (result->boottime) 
  743.             boottime = convert_time(result->boottime);
  744.         messagesIn = result->messagesIn;
  745.         messagesOut = result->messagesOut;
  746.         addrIn = result->addrIn;
  747.         addrOut = result->addrOut;
  748.         opsPerSec = (double) result->opsPerSec;
  749.         runnableChans = (double) result->runnableChans;
  750.         msgsInPerSec = (double) result->msgsInPerSec;
  751.         msgsOutPerSec = (double) result->msgsOutPerSec;
  752.         maxChans = result->maxChans;
  753.         currChans = result->currChans;
  754.         delta_volume = result->totalVolume - total_volume;
  755.         total_volume = result->totalVolume;
  756.         delta_messages = result->totalMsgs - total_number_messages;
  757.         total_number_messages = result->totalMsgs;
  758.         delta_reports = result->totalDrs - total_number_reports;
  759.         total_number_reports = result->totalDrs;
  760.         /* refresh display */
  761.         update_time_label();
  762.         display_totals();
  763.     }
  764.     return OK;
  765. }
  766.     
  767.